package cn.peng.stu4teach.pages.my;

import android.app.Application;
import android.content.Context;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;

import cn.peng.stu4teach.util.update.AppUpdateUtil;

/**
 * 功用：MyFragment 中使用的 Vm
 */
public class MyFmVm extends AndroidViewModel {
    public MyFmVm (@NonNull Application application) {
        super(application);
    }

    /**
     * 点击了app升级
     */
    public void onAppUpdate (Context pCtx) {
        Context appCtx = pCtx.getApplicationContext();
        String url = "https://dl.hdslb.com/mobile/latest/android64/iBiliPlayer-bili.apk";
        AppUpdateUtil.getInstance().startDownLoad(appCtx, "哔哩哔哩", url);
    }
}
